# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=htrosbif
pkgver=134.9dc3f86
pkgrel=10
groups=('blackarch' 'blackarch-fingerprint' 'blackarch-recon')
pkgdesc='Active HTTP server fingerprinting and recon tool.'
arch=('any')
url='https://github.com/lkarsten/htrosbif'
license=('GPL3')
depends=('perl' 'perl-json-xs' 'perl-list-moreutils' 'perl-test-deep')
makedepends=('git')
source=("git+https://github.com/lkarsten/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" REQUIREMENTS
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  rm COPYING REQUIREMENTS

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec perl $pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

